#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int > vec;
typedef pair < int , int > pii;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

int pw[20], a[20], top, s, n;

void solve() {
    s = in, n = in; top = 0;
	while(s) { a[++top] = s % 10; s /= 10; }
	int sum = 0;
	rep(i, 1, top) sum += a[i];
	while(sum < n) {
		rep(i, 2, top) 
			if(a[i]) {
				sum += 9; a[i]--; a[i - 1] += 10; break;
			}
	}
	rep(i, 1, top)
		while(a[i] && n > 1) {
			printf("%d ",pw[i]); a[i]--; n--;
		}
	sum = 0;
	rep(i, 1, top) sum += a[i] * pw[i];
	printf("%d\n",sum);
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	pw[1] = 1; rep(i, 2, 10) pw[i] = pw[i - 1] * 10;
    for(int T = in;T;T--) solve();
}
